package com.bigData.main.controller;


import com.bigData.main.pojo.UserInfo;
import com.bigData.main.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class UserController {
    @Resource
    UserService use;

    //此接口实现用户查询
    @RequestMapping("/select/Userinfo")
    public List<UserInfo> selectUser(UserInfo u) {
        return use.selectUserInfo(u);
    }

    @RequestMapping("delete/Userinfo")
    public Integer deleteUser(UserInfo u) {
        return use.deleteUserInfo(u);
    }

    @RequestMapping("update/UserinfoName")
    public Integer updateUsername(UserInfo u) {
        return use.updateUserNameInfo(u);
    }

    @RequestMapping("update/UserinfoPass")
    public Integer updateUserpass(UserInfo u) {
        return use.updateUserPassInfo(u);
    }

    @RequestMapping("update/Urootinfo")
    public Integer updateUroot(UserInfo u) {
        return use.updateUrootInfo(u);
    }

    @RequestMapping("insert/Userinfo")
    public Integer insertUser(UserInfo u) {
        return use.insertUserInfo(u);
    }

    //登录校验方法
    @RequestMapping("/login")
    public UserInfo login(UserInfo u) {
        return use.getUserPassWord(u);
    }

    //用户注册
    @RequestMapping("/zhuce")
    public Integer zhuce(UserInfo u) {
        return use.userRegister(u);
    }

}